import { Log } from "../../../../../Core/Module/Log/Log";
import { FUIGlobalComponent } from "../../../../ModelView/Client/Demo/Global/FUIGlobalComponent";
import { UIPanelType } from "../../../../ModelView/Client/Plugins/FairyGUI/PanelDataDefine";

export class FUIRootHelper {

    public static Init(): void {

    }

    public static GetTargetRoot(type: UIPanelType): fgui.GComponent {
        if (type == UIPanelType.Normal) {
            return FUIGlobalComponent.Instance.NormalGRoot;
        }
        else if (type == UIPanelType.Fixed) {
            return FUIGlobalComponent.Instance.FixedGRoot;
        }
        else if (type == UIPanelType.PopUp) {
            return FUIGlobalComponent.Instance.PopUpGRoot;
        }
        else if (type == UIPanelType.Other) {
            return FUIGlobalComponent.Instance.OtherGRoot;
        }
        Log.Error(`uiroot type is error: ${type}`);
        return null;
    }
}